<?php
namespace Plu\Library\Services\Platform\Seo;

use Plu\Library\Services\ServiceBase,
    Plu\Library\Models\Platform\Seo\RoomSeo as RoomSeoModel;

class SeoService extends ServiceBase {
    const CACHE_TIME = 120;

    static public function getChannel($domain) {
        $guid = sprintf('lz_cnl_seo_%s', $domain);
        $seoInfo = self::getCacheHandler()->get($guid, self::CACHE_TIME);

        if (empty($seoInfo)) {
            $seoInfo = RoomSeoModel::getItem($domain, RoomSeoModel::TYPE_CHANNEL);

            self::getCacheHandler()->save($guid, $seoInfo, self::CACHE_TIME);
        }

        return $seoInfo;
    }
}
